Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade to a4 and add automatic-translations #3

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

agilbert
Copy link
Member

Summary

I wanted to record a quick video of translations working with this demo instance, so I upgraded to A4 and installed that module.

Here's the video.

What kind of change does this PR introduce?

(Check at least one)

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • Build-related changes
  • Other

@agilbert agilbert requested a review from boutell August 17, 2024 00:51
@@ -17,7 +17,7 @@ async function go() {
// your repo name followed by a -, however if you plan to use a
// cheap Atlas cluster (below M10), you must use a unique prefix less
// than 12 characters (before the -).
shortNamePrefix: process.env.APOS_PREFIX || 'a3hpab-',
shortNamePrefix: process.env.APOS_PREFIX || 'demo-local-',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not a universal demo... how about skhosp-?

@@ -21,9 +21,10 @@
"author": "Apostrophe Technologies",
"license": "MIT",
"dependencies": {
"@apostrophecms-pro/automatic-translation": "^1.1.0",
"@apostrophecms-pro/document-versions": "^1.0.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extendRestApiRoutes(self) {
return {
get: {
'/locales': async (req) => {
Copy link
Member

@boutell boutell Aug 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the async here as you're not doing anything async, so remove that.

I just PR'd the same route into core but it's OK to have this here too until that ships and it doesn't have to be removed immediately since it just replaces it with the same implementation.

@@ -0,0 +1,12 @@
module.exports = {
// add a route to get all configured locales
extendRestApiRoutes(self) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be just apiRoutes. restApiRoutes is for implementing certain classic route patterns e.g. GET or POST straight to the module name like /api/v1/mymodulename and so on. And extend... functions are used only when you're interested in calling the original via _super.

For this case just do apiRoutes and it's otherwise correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants